//
//  YTRankCell.m
//  yitaicaijing
//
//  Created by DIANGHONG on 2018/8/13.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "YTRankCell.h"
@interface YTRankCell ()

@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *calcPowerLabel;
@property (weak, nonatomic) IBOutlet UILabel *rankDesLabel;
@property (weak, nonatomic) IBOutlet UIImageView *rankImageView;

@end
@implementation YTRankCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setTag:(NSInteger)tag
{
    [super setTag:tag];
    
    switch (tag)
    {
        case 1: // 第一名
            self.rankDesLabel.hidden = YES;
            self.rankImageView.hidden = false;
            self.rankImageView.image = [UIImage imageNamed:@"rank_1"];
            break;
        case 2:
            self.rankDesLabel.hidden = YES;
            self.rankImageView.hidden = false;
            self.rankImageView.image = [UIImage imageNamed:@"rank_2"];
            break;
        case 3:
            self.rankDesLabel.hidden = YES;
            self.rankImageView.hidden = false;
            self.rankImageView.image = [UIImage imageNamed:@"rank_3"];
            break;
        default:
            self.rankDesLabel.hidden = false;
            self.rankImageView.hidden = YES;
            self.rankDesLabel.text = [NSString stringWithFormat:@"%zd",tag];
            break;
    }
    
   
}

- (void)setModel:(YTRankModel *)model
{
    _model = model;
    NSLog(@"%@",model.money);
    self.nameLabel.text = model.display_name;
    self.calcPowerLabel.text = model.money;
}

@end
